#==============================================================================
#                              -*- python -*-
#
#  $Id: setup.py.in,v 1.1 2002/02/28 00:02:28 mike Exp $
#
"""
   This script generates my setup.py from information in the Makefile.
"""
#
#  Copyright (C) 2000 Michael A. Muller
#
#  Permission is granted to use, modify and redistribute this code,
#  providing that the following conditions are met:
#
#  1) This copyright/licensing notice must remain intact.
#  2) If the code is modified and redistributed, the modifications must 
#  include documentation indicating that the code has been modified.
#  3) The author(s) of this code must be indemnified and held harmless
#  against any damage resulting from the use of this code.
#
#  This code comes with ABSOLUTELY NO WARRANTEE, not even the implied 
#  warrantee of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
#
#==============================================================================

import sys, string

dst = open('setup.py', 'w')

dst.write("""#!/usr/bin/env python

from distutils.core import setup

setup(name = 'dopy',
      version = %s,
      description = 'DOPY Distributed Object System',
      author = 'Michael Muller',
      author_email = 'mmuller@enduden.com',
      url = 'http://www.users.cloud9.net/~proteus/dopy',
#      packages = ['dopy'],
      package_dir = { 'dopy': '' },
      py_modules = [ """ % repr(sys.argv[1])
)

for mod in sys.argv[2:]:
   dst.write("'dopy.%s', " % string.split(mod, '.')[0])
      

dst.write(']\n)\n')      
